using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vt_test2Map : EntityTypeConfiguration<vt_test2>
    {
        public vt_test2Map()
        {
            // Primary Key
            this.HasKey(t => new { t.Test, t.Query });

            // Properties
            this.Property(t => t.Test)
                .IsRequired()
                .HasMaxLength(31);

            this.Property(t => t.Query)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("vt_test2");
            this.Property(t => t.Test).HasColumnName("Test");
            this.Property(t => t.Result).HasColumnName("Result");
            this.Property(t => t.Query).HasColumnName("Query");
        }
    }
}
